<%@page import="model.bean.DailyLog"%>
<%@page import="model.bean.Service"%>
<%@page import="java.util.ArrayList"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Daily Log</title>
<script type="text/javascript" src="${pageContext.request.contextPath}/assets/js/jquery-1.8.2.min.js"></script>
<script>
$(document).ready(function(){
	$(".bound").hide();
	$(".showAdd").click(function(){
		$(this).hide();
		$(".bound").show();
		
	});
	
	
});
</script>
<style type = "text/css">
.showRs{
}
#main{
margin-top:15px;
float:left;
margin-left:100px;
overflow: hidden;
width:700px;
height: auto;
border: 1px solid #AC8853;
border-radius:5px;
}
.bag {
overflow: hidden;
height:auto;
}
#main *{
border-radius:5px;
border-color: #AC8853;
font-style: oblique;
font-family: Serif;
}
#main .lb {
width: 150px;
display:block;
float:left;
margin: 3px 3px 3px 3px;
line-height: 25px;
}
#main .ip {
width: 220px;
display:block;
float:left;
margin: 3px 3px 3px 3px;
line-height: 25px;
}
.tableTour {
width: auto;
display:block;
float:left;
margin: 3px 3px 3px 3px;
line-height: 25px;
border-radius: 5px;
border: 2px solid #AC8853;
font-style: oblique;
font-family: Serif;
}
.showAdd{
display:block;
overflow:hidden;
border: 1px solid #AC8853;
}
.panel-body {
width:800px;
}
</style>
</head>
<body>
<jsp:include page="common/header.jsp"></jsp:include>
<div id="page-wrapper">
<h3>Daily Log</h3>

<div class = "showRs">
<%
ArrayList<DailyLog> dailyLog = null;
dailyLog = (ArrayList<DailyLog>) request.getAttribute("dailyLog");
if (dailyLog != null && dailyLog.size()>=1) {
	%>
	<table border = "1px" width = "100%">
	<tr>
		<td>Mã Nhật Trình</td>
		<td>Ngày Đến</td>
		<td>Mã Khách Sạn</td>
		<td>Mã Nhà Hàng</td>
		<td>Mã Nhà Xe </td>
		<td>Mã Tour Mẫu </td>
		<td>Địa Chỉ</td>
	<% 
	for(int i = 0; i< dailyLog.size(); i++){
		%>
		<tr>
		<td><%=dailyLog.get(i).getDailyId() %></td>
		<td><%=dailyLog.get(i).getDayCome() %></td>
		<td><%=dailyLog.get(i).getHotelId() %></td>
		<td><%=dailyLog.get(i).getResId() %></td>
		<td><%=dailyLog.get(i).getTrafficId() %></td>
		<td><%=dailyLog.get(i).getTourId() %></td>
		<td><%=dailyLog.get(i).getTarget() %></td>
		<td>Xóa Nhật Trình</td>
		</tr>
<%
	}
%>
	</table>
	<%
}
else {
	%> <p><%="Chưa có nhật trình cho tour"%></p><%
}
%>
<div class = "panel-body">
<div id = "main">
<form method = "post" action = "${pageContext.request.contextPath}/TourUpdateServlet">
<div class = "bound" >
<input type = "hidden" name = "tourId" value = "<%=request.getParameter("tourId")%>"/>
<div class = "bag"><label class = "lb">Địa điểm: </label><select name = "target" class = "ip">
<%
 ArrayList<Service> target = null;
 target = (ArrayList<Service>)request.getAttribute("target");
 if (target != null){
	 for ( int i = 0; i < target.size(); i++){
%>
<option value = "<%=target.get(i).getIndex()%>"><%=target.get(i).getName()%></option>
<%
 }
 }
%>
</select>
</div>
<div class = "bag">
<label class = "lb">Nhà xe: </label><select name = "traffic" class = "ip">
<%
 ArrayList<Service> traffic = null;
 traffic = (ArrayList<Service>)request.getAttribute("traffic");
 if (traffic != null){
	 for ( int i = 0; i < traffic.size(); i++){
%>
<option value = "<%=traffic.get(i).getIndex()%>"><%=traffic.get(i).getName()%></option>
<%
 }
 }
%>
</select>
</div>
<div class = "bag">
<label class = "lb">Nhà hàng: </label><select name = "res" class = "ip">
<%
 ArrayList<Service> res = null;
 res = (ArrayList<Service>)request.getAttribute("res");
 if (res != null){
	 for ( int i = 0; i < res.size(); i++){
%>
<option value = "<%=res.get(i).getIndex()%>"><%=res.get(i).getName()%></option>
<%
 }
 }
%>
</select></div>
<div class = "bag">
<label class = "lb">Khách san: </label><select class = "ip" name = "hotel">
<%
 ArrayList<Service> hotel = null;
 hotel = (ArrayList<Service>)request.getAttribute("hotel");
 if (hotel != null){
	 for ( int i = 0; i < hotel.size(); i++){
%>
<option value = "<%=hotel.get(i).getIndex()%>"><%=hotel.get(i).getName()%></option>
<%
 }
 }
%>
</select>
</div>
<input type = "submit" name = "process" value = "updateLog" />
</div>
</form>
<label class = "showAdd">Thêm Nhật Trình</label>
</div>
</div>
</div>
</div>
<jsp:include page="common/footer.jsp"></jsp:include>
</body>
</html>